package collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;

public class StreamApiDemo1 {
    public static void main(String[] args) {
        Random rand=new Random();
        List<Integer> list=new ArrayList<>();
        for (int i=0;i<10;i++){
            list.add(rand.nextInt(100));
        }
        System.out.println(list);
        List<Integer>list2=list.stream().map(e->e*3).collect(Collectors.toList());
        System.out.println(list2);
        List<Integer>list3=list.stream().map(e->e*3).filter(e->e%2==0).sorted().collect(Collectors.toList());
        System.out.println(list3);
    }
}
